library(tidyverse)
Registered S3 methods overwritten by 'dbplyr':
  method         from
  print.tbl_lazy     
  print.tbl_sql      
── Attaching packages ───────────────────────────── tidyverse 1.3.0 ──
✓ ggplot2 3.3.3     ✓ purrr   0.3.4
✓ tibble  3.0.6     ✓ dplyr   1.0.5
✓ tidyr   1.1.3     ✓ stringr 1.4.0
✓ readr   1.4.0     ✓ forcats 0.5.1
── Conflicts ──────────────────────────────── tidyverse_conflicts() ──
x dplyr::filter() masks stats::filter()
x dplyr::lag()    masks stats::lag()
library(tidyverse)
library(sf)
Linking to GEOS 3.8.1, GDAL 3.1.4, PROJ 6.3.1
scotland <- read_sf("~/SG_NHS_HealthBoards_2019.shp")
GDAL Error 4: Unable to open /Users/emilyjaco/SG_NHS_HealthBoards_2019.shx or /Users/emilyjaco/SG_NHS_HealthBoards_2019.SHX. Set SHAPE_RESTORE_SHX config option to YES to restore or create it.Error: Cannot open "/Users/emilyjaco/SG_NHS_HealthBoards_2019.shp"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.
class(scotland)
[1] "sf"         "tbl_df"     "tbl"        "data.frame"
head(scotland, 14)
Simple feature collection with 14 features and 4 fields
Geometry type: MULTIPOLYGON
Dimension:     XY
Bounding box:  xmin: 5512.998 ymin: 530250.8 xmax: 470332 ymax: 1220302
Projected CRS: OSGB 1936 / British National Grid
scotland_geometry
Geometry set for 14 features 
Geometry type: MULTIPOLYGON
Dimension:     XY
Bounding box:  xmin: 5512.998 ymin: 530250.8 xmax: 470332 ymax: 1220302
Projected CRS: OSGB 1936 / British National Grid
First 5 geometries:
MULTIPOLYGON (((201916.2 600444.4, 201918.4 600...
MULTIPOLYGON (((345325.9 579663.3, 345325.1 579...
MULTIPOLYGON (((266004.4 543544.6, 266010.9 543...
MULTIPOLYGON (((256533 740502, 256501.5 740379,...
MULTIPOLYGON (((383521.2 771234.7, 383524.3 771...
LS0tCnRpdGxlOiAiUiBOb3RlYm9vayIKb3V0cHV0OiBodG1sX25vdGVib29rCi0tLQoKYGBge3J9CmxpYnJhcnkodGlkeXZlcnNlKQpsaWJyYXJ5KHNmKQpgYGAKCmBgYHtyfQpzY290bGFuZCA8LSByZWFkX3NmKCIuLi9kYXRhX3Jhdy9TR19OSFNfSGVhbHRoQm9hcmRzXzIwMTkvU0dfTkhTX0hlYWx0aEJvYXJkc18yMDE5LnNocCIpCmBgYAoKYGBge3J9CmNsYXNzKHNjb3RsYW5kKQpgYGAKCmBgYHtyfQpoZWFkKHNjb3RsYW5kLCAxNCkKYGBgCgpgYGB7cn0Kc2NvdGxhbmRfZ2VvbWV0cnkgPC0gc3RfZ2VvbWV0cnkoc2NvdGxhbmQpCgpzY290bGFuZF9nZW9tZXRyeQpgYGAKCg==